package com.ag.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * TbLog entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_LOG", schema = "dbo", catalog = "AGDB")
public class TbLog implements java.io.Serializable {

	// Fields

	private String logId;
	private TbLogType tbLogType;
	private TbLogPlanStep tbLogPlanStep;
	private TbPlan tbPlan;
	private TbEvent tbEvent;
	private Date logTime;
	private String logContent;

	// Constructors

	/** default constructor */
	public TbLog() {
	}

	/** full constructor */
	public TbLog(TbLogType tbLogType, TbLogPlanStep tbLogPlanStep,
			TbPlan tbPlan, TbEvent tbEvent, Date logTime, String logContent) {
		this.tbLogType = tbLogType;
		this.tbLogPlanStep = tbLogPlanStep;
		this.tbPlan = tbPlan;
		this.tbEvent = tbEvent;
		this.logTime = logTime;
		this.logContent = logContent;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "LOG_ID", unique = true, nullable = false, length = 32)
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LT_ID")
	public TbLogType getTbLogType() {
		return this.tbLogType;
	}

	public void setTbLogType(TbLogType tbLogType) {
		this.tbLogType = tbLogType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PS_ID")
	public TbLogPlanStep getTbLogPlanStep() {
		return this.tbLogPlanStep;
	}

	public void setTbLogPlanStep(TbLogPlanStep tbLogPlanStep) {
		this.tbLogPlanStep = tbLogPlanStep;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_ID")
	public TbPlan getTbPlan() {
		return this.tbPlan;
	}

	public void setTbPlan(TbPlan tbPlan) {
		this.tbPlan = tbPlan;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "E_ID")
	public TbEvent getTbEvent() {
		return this.tbEvent;
	}

	public void setTbEvent(TbEvent tbEvent) {
		this.tbEvent = tbEvent;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "LOG_TIME", length = 23)
	public Date getLogTime() {
		return this.logTime;
	}

	public void setLogTime(Date logTime) {
		this.logTime = logTime;
	}

	@Column(name = "LOG_CONTENT", length = 4000)
	public String getLogContent() {
		return this.logContent;
	}

	public void setLogContent(String logContent) {
		this.logContent = logContent;
	}

}